<template>
  <div id="app">
    <router-view/>
  </div>
</template>
<script>
export default {
  name: "App",
  mounted() {
  document.addEventListener("mouseup",(e) => {
    const userCon = document.getElementById("children-view"); // 获取子视图
    const carsSwiper = document.getElementsByClassName("cars-wrap")[0]; // 获取车辆列表
    // console.log("__",carsSwiper)
    if(carsSwiper && !carsSwiper.contains(e.target)) {
      const inRequestCarsList = this.$store.state.app.isRequestCarsList;
      if(!inRequestCarsList) {
        this.$store.commit("app/SET_CARS_LIST_STATUS",false);
      }
      // 1. 点击地图，判断是不是点击了停车场，用inRequestCarsList做标记，true：是停车场，反之
      // 2. inRequestCarsList为false时，修改isClickCarsList为false，点击的不是车辆列表，那么隐藏车辆列表
    }
    if(userCon && !userCon.contains(e.target)) {
      this.$router.push({
        name: "Index"
      })
    }
  })
},
}
</script>

<style lang="scss">
#app {}

</style>
